<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试获取 Token</title>
    <script>
        async function getToken() {
            try {
                const response = await fetch("https://open.xjguoyu.cn/api/auth/oauth/token?grant_type=client_credentials&client_id=6d9ed85e9826e6de8b6a39cea81bba86&secret=xYXYcMmBeTDRGa6HQwPpRCieTfzbKcDZ");
                const data = await response.json();
                console.log(data);
                alert("获取的 access_token: " + data.access_token);
            } catch (error) {
                console.error("发生错误:", error);
            }
        }
    </script>
</head>
<body>
    <h1>测试获取 Token</h1>
    <button onclick="getToken()">获取 Token</button>
</body>
</html>